package cn.doitedu.rtmk.mgmt.doit39_rtmk_management.controller;


import cn.doitedu.rtmk.mgmt.doit39_rtmk_management.service.MathService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@Slf4j
public class MathOperate {

    MathService mathService = new MathService();


    @RequestMapping("/api/add")
    public int add(int x, int y){
        log.warn("收到请求,参数x:{} ,y:{}",x,y);

        int res = mathService.plus(x, y);

        return res;
    }


    @RequestMapping("/api/multiply")
    public int multiply(int x, int y){
        return x*y;
    }


}
